The interface unit “@Python” allows executing Python code directly from the EbsScript. Both code directly and Python files (*.py) can be executed. For using the interface
During the execution of an EbsScript, the global dictionary of Python is retained, i.e. several calls to Python executed in a row can e.g. create Python variables and subsequently
read them out.
CAUTION: After terminating an EbsScript, the global Python dictionary is deleted. Accessing variables from a previous EbsScript run is thus no longer possible via the
dictionary (this can e.g. be achieved by means of “Python pickling”) The following functions/procedures are contained in>“@Python”.
function pyEvaluate(expression:string):variant; internal;
evaluates “expression” and returns the result.
procedure pyExecute(expression:string); internal;
executes the code in “expression”.
procedure pyExecuteFile(file:string); internal;
executes the code contained in “file”.
function pyGetVariable(name:String):variant; internal;
returns the value of the global variable “name” (i.e. element of the global dictionary).
procedure pySetVariable(name:String; const value:variant); internal;
sets the values of the global variable “name”.
function pyLoadInterpreter():boolean; internal;
explicitly load python-interpreter; result is true if interpreter could be loaded (or was already loaded) note: explicitly loading the python-interpreter is not necessary.
function pyUnloadInterpreter():boolean; internal;
unloads the python-interpreter; result is true if interpreter could be unloaded successfully (or was not loaded)
function pyIsInterpreterLoaded():boolean; internal;
test, if the python-interpreter is loaded; result is true if interpreter is loaded
procedure pySetFullyQualifiedLogfileName(path:string); internal;
set the fully qualified path of the log-file
function pyGetFullyQualifiedLogfileName():string; internal;
get the fully qualified path of the log-file
procedure pyEnableLogging(enable:boolean = true); internal;
enable/disable logging
function pyIsLoggingEnabled():boolean; internal;
returns true if logging is enabled
The interface unit “@Python” allows executing Python code directly from the EbsScript. Both code directly and Python files (*.py) can be executed. For using the interface
During the execution of an EbsScript, the global dictionary of Python is retained, i.e. several calls to Python executed in a row can e.g. create Python variables and subsequently
read them out.
CAUTION: After terminating an EbsScript, the global Python dictionary is deleted. Accessing variables from a previous EbsScript run is thus no longer possible via the
dictionary (this can e.g. be achieved by means of “Python pickling”) The following functions/procedures are contained in>“@Python”.